package com.ck.data.controller;

import com.ck.common.constant.AjaxResult;
import com.ck.data.mapper.PrivacyMapper;
import com.ck.data.pojo.UserInfoEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ck
 * @date 2023/11/7 11:28
 */
@RestController
@Slf4j
@RequestMapping("/privacy")
public class PrivacyController {

    /**
     * 接口返回数据脱敏：
     * 整合jackson，在序列化阶段对特定字段脱敏
     * @return
     */
    @GetMapping("/desensitization")
    public AjaxResult Desensitization(){
        UserInfoEntity info = new UserInfoEntity();
        info.setName("常康");
        info.setPassword("Ckjhakdbadbjwqkj");
        info.setPhone("17758999271");
        info.setIdCard("4306298123771237918379");
        return AjaxResult.success(info);
    }
}
